<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--#include file="DataLoad.asp"-->
<%Call CheckAdmin2()%>
<html>
<head>
<title><%=GuildName%> - DKP系统</title>
<script language="JavaScript" src="inc/jquery.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="Generator" content="EditPlus">
<meta name="Author" content="SULei">
<meta name="Keywords" content="DKP WOW GUILD">
<meta name="Description" content="">
<link href="<%=StylePath%>/main.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="<%=StylePath%>/styleplus.js"></script>
<style type="text/css" media="all">

</style>


</head>

<body>

<div class="header">
<!--#include file="menu.asp"-->
</div>
<div class="main">
			<%
			if Session(ULVL)>1 then
				Showerror("权限不足")
				response.end
			end if
				dim sdate

			select case Request("action")
			case "add"
				Call rule_ADD()
			case "edit"
				Call rule_editFrom(Request("id"))
			case "del"
				Call ruledel(Request("id"))
				call rule_list("")
			case Else
				Response.write "<b>规则只作为一个默认设置,所有的分数都可以通过活动的事件进行调整.</b>"
				Call rule_addFrom()
				call rule_list("")
			end select
			%>
  </div>
<div id="footer"><!--#include file="footer.asp"--></div>
</body>
</html>
<%
SUB rule_addFrom()
	sdate=now()
	'特殊事件添加表单
	'马甲替身, 仓库购买, 纪律奖惩, DKP转让, 其它
			Response.write "<form name='ruleAdd' action='admin_ruleAdd.asp?action=add' method='post'>"
			Response.write "<table class='outframe interlace'>"
			Response.write "<tr><th colspan='3'>新增分配规测</th></tr>"
			
			Response.write "<tr><td>规则名</td><td><input type='text' name='ruler_name' size='10' value='' /></td><td></td></tr>"
			Response.write "<tr><td>活动参与加分</td><td><input type='text' name='ruler_attendee' size='5' value='0' /></td><td>全程参与者可以得到设定的分数,非全程者可以得到一半的分数. 根据公会制度可以选择更为灵活的活动事件来处理参与分的计算.</td></tr>"
			Response.write "<tr><td>BOSS击杀</td><td><input type='text' name='ruler_farmdown' size='5' value='0' /></td><td>击杀BOSS加分,这里的值只作为具体击杀事件的默认值,在活动事件中可以为特定BOSS击杀重新指定得分.</td></tr>"
			Response.write "<tr><td>BOSS首次击杀</td><td><input type='text' name='ruler_firstdown' size='5' value='0' /></td><td>适用于公会开荒期的奖励</td></tr>"
'			Response.write "<tr class='a'><td>BOSS发现</td><td><input type='text' name='ruler_findboss' size='5' value='0' /></td><td>适用于公会开荒期的奖励</td></tr>"
			Response.write "<tr><td>装备绑定物品</td><td><input type='text' name='ruler_BOE' value='0' size='6'/></td><td></td></tr>"
			Response.write "<tr><td>物品分解</td><td><input type='text' name='ruler_ENC' value='0' size='6'/></td><td></td></tr>"

			Response.write "<tr><td></td><td><input type='submit' value='添加'/><input type='hidden' name='postid' value='0' /></td><td></td></tr>"
			
			Response.write "</table>"
			Response.write "</form>"	
end sub


SUB rule_editFrom(id)
	if not isNumeric(id) then exit sub
	sdate=now()
	'特殊事件添加表单
	'马甲替身, 仓库购买, 纪律奖惩, DKP转让, 其它
	sql="select * from ruler where id="&id
	rs.open sql,conn,1,1
		if rs.bof or rs.eof then
		else
			Response.write "<form name='ruleEdit' action='admin_ruleAdd.asp?action=edit' method='post'>"
			Response.write "<table class='reportform outframe interlace'>"
			Response.write "<tr><th colspan='7'>编辑分配规测</th></tr>"
			Response.write "<tr class='coltitle'><td>规则描述</td><td>活动参与加分<br>(非全程者/2)</td><td>BOSS击杀<br>(击杀BOSS加分)</td><td>BOSS首次击杀</td><td>装备绑定物品</td><td>物品分解</td><td></td></tr>"
			Response.write "<tr><td><input type='text' name='ruler_name' size='10' value='"&rs("ruler_name")&"' /></td><td><input type='text' name='ruler_attendee' size='5' value='"&rs("ruler_attendee")&"' /></td><td><input type='text' name='ruler_farmdown' size='5' value='"&rs("ruler_farmdown")&"' /></td><td><input type='text' name='ruler_firstdown' size='5' value='"&rs("ruler_firstdown")&"' /></td>"
			Response.write " <td><input type='text' name='ruler_BOE' value='"&rs("ruler_BOE")&"' size='6'/></td><td><input type='text' name='ruler_ENC' value='"&rs("ruler_ENC")&"' size='6'/></td><td><input type='submit' value='修改'/><input type='hidden' name='postid' value='"&rs("id")&"' /></td></tr>"
			Response.write "</table>"
			Response.write "</form>"	
		end if
	rs.close
end sub

SUB rule_list(sstr)
	'特殊事件列表
	Dim sctstr
	Select Case sstr
	Case ""
		sctstr=""
	Case ""
		sctstr=""
	Case ""
		sctstr=""
	Case ""
		sctstr=""
	Case ""
		sctstr=""
	Case else
		sctstr=""
	End Select

	Response.write "<table class='outframe interlace'>"
	Response.write "<tr><th colspan='7'>现有分配规则(建议不要删除现有规则,而是通过修改和添加新规则来调整设置)</th></tr>"
	Response.write "<tr class='coltitle'><td>描述</td><td>参与</td><td>击杀</td><td>首次</td><td>装备绑定</td><td>分解</td><td></td></tr>"
	sql="select * from ruler order by id desc"
	rs.open sql,conn,1,1
	if rs.bof or rs.eof then
		Response.write "<tr><td colspan='7'>None.</td></tr>"
	else
		for i=1 to rs.recordcount
		Response.write "<tr class='"&linec(i)&"'><td>"&rs("ruler_name")&"</td><td>"&rs("ruler_attendee")&"</td><td>"&rs("ruler_farmdown")&"</td><td>"&rs("ruler_firstdown")&"</td><td>"&rs("ruler_BOE")&"</td><td>"&rs("ruler_ENC")&"</td><td><a href='?action=edit&id="&rs("id")&"'>编辑</a> <a href='?action=del&id="&rs("id")&"'>删除</a></td></tr>"
		rs.movenext
		next
	end if
	rs.close
	Response.write "</table>"
end sub


SUB SE_ADD()
	'特殊事件添加SQL
end sub

sub ruledel(id)
	if not IsNumeric(request("postid")) then exit sub
	sql="delete 1 from ruler where id="&request("id")
	conn.execute(sql)
	Response.redirect Url
end sub
%>